<!DOCTYPE html>
<html>
	<head>
	    <title>用户管理</title>
	    <meta charset="UTF-8">
	    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	    <link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.min.css" />
	    <link rel="stylesheet" type="text/css" href="css/style.css" />
	    <script type="text/javascript" src="js/jquery.min.js"></script>  
	</head>
	<body>
<?php

error_reporting(5);
error_reporting(E_ALL & ~E_NOTICE);
error_reporting(0);
include_once('../dbtools.inc.php');
include_once('../config.php');
$uname=$_POST['uname'];
$field=$uname;
	       if($field!=""){
include_once('../config.php');	       	
	       	$sql="SELECT * FROM users WHERE uname like '%$field%' OR userid like '%$field%' OR uphone like '%$field%' OR uaddress like '%$field%' OR pub_time like '%$field%'";
	       	$result = mysqli_query($config,$sql) or die ('SQL语句有误：'.mysqli_error($config));
	       }

// $field=$_GET['search'];
// 	       if($field!=""){
	       	// $sql="SELECT * FROM users WHERE `uname`='$uname'";
	       	// $result = mysqli_query($config,$sql) or die ('SQL语句有误：'.mysqli_error());
	       // }
	       // var_dump($sql);

	?>

		<form class="form-inline definewidth m20" action="back_user_search.php" method="post" name="form_search">
			用户名：<input name="uname" id="search" placeholder="搜索用户" class="abc input-default" value=""></input>&nbsp;&nbsp;
			<button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp;
		</form>
		<table class="table table-bordered table-hover definewidth m10">
		    <thead>
			    <tr>
			        
			        <th>用户名</th>
			        <th>邮箱</th>
			        <th>电话</th>
			     
			        <th style="text-align:center;">操作</th>
			    </tr>
		    </thead>


            <?php while ($ro=mysqli_fetch_array($result)){?>

		
			<tr>
			
				<td><?php echo $ro['uname'];?></td>
				<td><?php echo $ro['uemail'];?></td>
				<td><?php echo $ro['uphone'];?></td>
				<!-- <td></td>
				<td>管理员</td>
				<td>已登录</td>
				<td>2017-5-15 14:00:00</td>
				<td><font color="green">正常</font></td> -->
				<td style="text-align:center;">
						<a href="back_user_delete.php?id=<?php echo $ro['userid']?>" onclick="return confirm('是否移除该用户？');">移除</a>

				</td>
			</tr>
			
			 <?php } ?>
		</table>
	</body>
</html>